<?php

/**
 * 框架基类
 */

namespace wtfphp;

class base {
    final function __construct() {
        static::_initialize();
    }

    /**
     * initialize()：优化实现__construct
     */
    private function _initialize() {
        static $run = false;
        if (!$run) {
            $run = true;
            if (method_exists($this, 'initialize')) {
                $this->initialize();
            }
        }
    }

    function __get($name) {
        return \wtfphp\di::get($name);
    }
}